<template>
  <ul class="activity-list-wrap">
    <li v-for="v in list" :key="v">
      <div class="activity-info">
        <div class="brand-img">
          <img alt="" />
        </div>
        <div class="brand-des">
          <span class="brand-name">秋水伊人</span>
          <div class="mark-wrap">
            <span class="scaleFont">252款</span>
            <span class="scaleFont">20%店主已加价</span>
          </div>
        </div>
        <div class="brand-right">
          <p>默认加价<span class="mark">5元</span></p>
          <div class="btn-add-price" @click.stop="handleAddPrice(v)">
            <span>加价</span>
          </div>
        </div>
      </div>
      <div style="overflow:hidden;">
        <div class="product-list-wrap">
          <div
            class="product-list-item"
            v-for="index in [1, 2, 3, 4, 5, 6, 7, 8, 9]"
            :key="index"
          >
            <div class="product-img-wrap">
              <img alt="" />
              <div class="earn-price"><span>赚￥10</span></div>
            </div>
            <p class="product-des">一字肩蕾丝荷叶你啊哈哈你哈</p>
            <p class="product-price">
              <span class="discount-price"
                ><span style="font-size: 12px;margin-right: 3px">¥</span
                >45</span
              >
              <span class="price">¥200</span>
            </p>
          </div>
        </div>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  name: 'activityList',
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {};
  },
  methods: {
    handleAddPrice(v) {
      this.$app.statistic({
        actionType: 'click',
        spm: '1041.1036',
        mainProperties: {
          activity_id: v
        }
      });
      this.$emit('onAddPrice', v);
    }
  }
};
</script>

<style lang="scss" scoped>
.activity-list-wrap {
  li {
    margin: 0.2rem 0.24rem 0;
    height: 4.58rem;
    background-color: #fff;
    border-radius: 0.12rem;
    padding: 0.28rem 0 0.2rem 0.24rem;
    box-sizing: border-box;
  }

  .activity-info {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 0.24rem;

    .brand-img {
      width: 0.74rem;
      height: 0.74rem;
      background-color: orange;
      border-radius: 0.04rem;
      border: 1px solid rgba(51, 51, 51, 0.05);
      margin-right: 0.16rem;
      padding: 1px;
      box-sizing: border-box;
      display: flex;
      justify-content: center;
      align-items: center;

      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }

    .brand-des {
      font-size: 0;

      .brand-name {
        font-size: 0.28rem;
        color: #333333;
        font-family: PingFangSC-Medium;
        font-weight: 500;
      }

      .mark-wrap {
        font-size: 0;
        margin-top: 0.14rem;
        display: flex;
        justify-content: flex-start;

        span {
          font-family: PingFangSC-Regular;
          font-size: 0.2rem;
          display: block;
          /*transform: scale(0.83);*/
          /*transform-origin: left;*/

          &:first-child {
            padding: 0 0.14rem;
            color: #ff9725;
            border-radius: 2px;
            border: 1px solid #ff9725;
            margin-right: 0.08rem;
          }

          &:last-child {
            border-radius: 2px;
            border: 1px solid #586c94;
            color: #586c94;
            padding: 0 0.08rem;
            /*margin-left: -0.16rem;*/
          }
        }
      }
    }

    .brand-right {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: flex-end;

      p {
        text-align: center;
        color: #666666;
        font-size: 0.22rem;
        margin-bottom: 0.12rem;
        margin-right: 0.3rem;
        font-family: PingFangSC-Regular;
        /*transform: scale(0.92);*/
        /*transform-origin: left;*/

        .mark {
          color: #e62525;
        }
      }

      .btn-add-price {
        width: 1.28rem;
        height: 0.4rem;
        background: #e62525;
        border-radius: 0.32rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        margin-right: 0.28rem;
        line-height: normal;
        span {
          font-size: 0.22rem;
          font-family: PingFangSC-Regular;
          /*transform: scale(0.92);*/
          /*transform-origin: left;*/
        }
      }
    }
  }

  .product-list-wrap {
    display: flex;
    white-space: nowrap;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: left;
    -webkit-overflow-scrolling: touch; /* 用于 ios5+ */
    .product-list-item {
      width: 2.24rem;
      margin-right: 0.16rem;

      .product-img-wrap {
        width: 100%;
        height: 2.24rem;
        position: relative;

        img {
          width: 100%;
          height: 100%;
          border-radius: 2px;
        }

        .earn-price {
          width: 1.04rem;
          padding: 0.06rem 0;
          background: #f5f5f5;
          border-radius: 0 100px 100px 2px;
          position: absolute;
          left: 0;
          bottom: 0;
          color: #666666;
          text-align: center;
          span {
            font-size: 0.2rem;
            font-family: PingFangSC-Regular;
            display: inline-block;
            /*transform: scale(0.83);*/
          }
        }
      }
    }

    .product-des {
      width: 2.24rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: #333333;
      font-size: 0.24rem;
      margin-top: 0.08rem;
      margin-bottom: 0.04rem;
    }

    .product-price {
      font-size: 0;

      .discount-price {
        color: #e40000;
        font-size: 0.32rem;
        font-family: DINAlternate-Bold, DINAlternate;
        font-weight: bold;
      }

      .price {
        color: #999999;
        font-size: 0.22rem;
        font-family: PingFangSC-Regular;
        margin-left: 0.08rem;
        text-decoration: line-through;
      }
    }
  }
}
</style>
